﻿using My.Admin.Enum;
using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace My.Admin.Model.System
{
	/// <summary>
	/// 系统字典类型表
	/// </summary>
	[SugarTable(null, "系统字典类型表")]
	public class SysDictType : EntityBase
	{
		/// <summary>
		/// 名称
		/// </summary>
		[SugarColumn(ColumnDescription = "名称", Length = 64)]
		[Required, MaxLength(64)]
		public virtual string Name { get; set; }

		/// <summary>
		/// 编码
		/// </summary>
		[SugarColumn(ColumnDescription = "编码", Length = 64)]
		[Required, MaxLength(64)]
		public virtual string Code { get; set; }

		/// <summary>
		/// 排序
		/// </summary>
		[SugarColumn(ColumnDescription = "排序")]
		public int OrderNo { get; set; } = 100;

		/// <summary>
		/// 备注
		/// </summary>
		[SugarColumn(ColumnDescription = "备注", Length = 256)]
		[MaxLength(256)]
		public string? Remark { get; set; }

		/// <summary>
		/// 状态
		/// </summary>
		[SugarColumn(ColumnDescription = "状态")]
		public StatusEnum Status { get; set; } = StatusEnum.Enable;

		/// <summary>
		/// 字典值集合
		/// </summary>
		[Navigate(NavigateType.OneToMany, nameof(SysDictData.DictTypeId))]
		public List<SysDictData> Children { get; set; }
	}
}
